package com.ruoyi.system.controller;


import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IBusinessCommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 业务Controller
 * 
 * @author wzf
 * @date 2021-05-04
 */
@Api(tags="共同业务")
@RestController
@RequestMapping("/business/common")
public class BusinessCommonController extends BaseController
{

    @Autowired
    private IBusinessCommonService businessCommonService;

    /**
     * 获取泵站列表
     * @return
     */
    // @PreAuthorize("@ss.hasPermi('business:common:bsGetPumpStationList')")
    @ApiOperation(value ="获取泵站列表")
    @PostMapping("/bsGetPumpStationList")
    public AjaxResult bsGetPumpStationList(@RequestBody String data) {
        JSONObject resMain = new JSONObject();
        JSONObject resPart1 = new JSONObject();
        try {
            resMain =  businessCommonService.bsGetPumpStationList(data);
        } catch (Exception e) {
            resPart1.put(Constants.RESULT_JSON_PART1_RESULT, Constants.SERVER_ERR_RESULT);
            resPart1.put(Constants.RESULT_JSON_PART1_ERRMSG, Constants.SERVER_ERR_MESSAGE);
            resMain.put(Constants.RESULT_JSON_PART1_NAME, resPart1);
            logger.error(Constants.SERVER_ERR_MESSAGE,e);
        }
        return AjaxResult.proSuccess(resMain);
    }

}

	

	


	

	


	

	



	

	
